package com.kaibes.orm.curd;

import java.util.ArrayList;
import java.util.List;

public class DeleteBuilder {

    private String tableName;
    private List<Query> queries;

    public DeleteBuilder() {
        queries = new ArrayList<Query>();
    }
    
    public DeleteBuilder setQueries(List<Query> queries) {
        this.queries = queries;
        return this;
    }
    
    public DeleteBuilder addQuery(Query query) {
        queries.add(query);
        return this;
    }
    
    public DeleteBuilder setTableName(String tableName) {
        this.tableName = tableName;
        return this;
    }
    
    public Delete build() {
        Delete delete = new Delete();
        delete.setTableName(tableName);
        delete.setQueries(queries);
        return delete;
    }
    
    public static DeleteBuilder newBuilder() {
        return new DeleteBuilder();
    }
    
}
